package com.team1.supervend.state_machine;

public class SuperVendTestDrive {

	public static void main(String[] args) {
		SuperVend superVend = new SuperVend();

		System.out.println("*************************************************************************************");
		System.out.println("Test #1 -- Check start sale then immediate cancel sale");
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println("EVENT TRIGGER               STATE OF SUPERVEND");
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println(superVend);
		System.out.println("--------------------------|----------------------------------------------------------");
		superVend.startSale();
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println(superVend);
		System.out.println("--------------------------|----------------------------------------------------------");
		superVend.cancelSale();
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println(superVend);
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println("*************************************************************************************");

		System.out.println(" ");

		System.out.println("*************************************************************************************");
		System.out.println("Test #2 -- Check basic pay by cash");
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println("EVENT TRIGGER               STATE OF SUPERVEND");
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println(superVend);
		System.out.println("--------------------------|----------------------------------------------------------");
		superVend.startSale();
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println(superVend);
		System.out.println("--------------------------|----------------------------------------------------------");
		superVend.preValidatePayment();
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println(superVend);
		System.out.println("--------------------------|----------------------------------------------------------");
		superVend.chooseCashPayment();
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println(superVend);
		System.out.println("--------------------------|----------------------------------------------------------");
		superVend.insertMoney(5.0f);
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println(superVend);
		System.out.println("--------------------------|----------------------------------------------------------");
		superVend.makeCashPayment();
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println(superVend);
		System.out.println("--------------------------|----------------------------------------------------------");
		superVend.allowProductSelection();
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println(superVend);
		System.out.println("--------------------------|----------------------------------------------------------");
		superVend.chooseProduct(3);
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println(superVend);
		System.out.println("--------------------------|----------------------------------------------------------");
		superVend.productSelectionComplete();
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println(superVend);
		System.out.println("--------------------------|----------------------------------------------------------");
		superVend.endSale();
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println(superVend);
		System.out.println("--------------------------|----------------------------------------------------------");
		superVend.returnToIdle();
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println(superVend);
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println("*************************************************************************************");

		System.out.println(" ");

		System.out.println("*************************************************************************************");
		System.out.println("Test #3 -- Check basic pay by credit card");
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println("EVENT TRIGGER               STATE OF SUPERVEND");
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println(superVend);
		System.out.println("--------------------------|----------------------------------------------------------");
		superVend.startSale();
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println(superVend);
		System.out.println("--------------------------|----------------------------------------------------------");
		superVend.preValidatePayment();
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println(superVend);
		System.out.println("--------------------------|----------------------------------------------------------");
		superVend.supplyCreditCardInformation();
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println(superVend);
		System.out.println("--------------------------|----------------------------------------------------------");
		superVend.insertMoney(5.0f);
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println(superVend);
		System.out.println("--------------------------|----------------------------------------------------------");
		superVend.paymentAuthorized();
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println(superVend);
		System.out.println("--------------------------|----------------------------------------------------------");
		superVend.allowProductSelection();
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println(superVend);
		System.out.println("--------------------------|----------------------------------------------------------");
		superVend.chooseProduct(3);
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println(superVend);
		System.out.println("--------------------------|----------------------------------------------------------");
		superVend.productSelectionComplete();
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println(superVend);
		System.out.println("--------------------------|----------------------------------------------------------");
		superVend.endSale();
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println(superVend);
		System.out.println("--------------------------|----------------------------------------------------------");
		superVend.returnToIdle();
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println(superVend);
		System.out.println("--------------------------|----------------------------------------------------------");
		System.out.println("*************************************************************************************");
	}
}
